﻿using Basic.FlowGatewayModule.Interface;
using Basic.FlowRemoteModel.NodeEvent.Model;
using WeDonekRpc.ApiGateway.Attr;
using WeDonekRpc.Helper.Validate;
using WeDonekRpc.HttpApiGateway;

namespace Basic.FlowGatewayModule.Api
{
    [ApiRouteName("/flow/node/event/{name}")]
    internal class FlowNodeEventApi : ApiController
    {
        private readonly IFlowNodeEventService _Service;

        public FlowNodeEventApi ( IFlowNodeEventService service )
        {
            this._Service = service;
        }

        public void Delete ( [NumValidate("flow.node.event.id.error", 1)] long id )
        {
            this._Service.Delete(id);
        }

        public NodeEventDto[] Gets ( [NumValidate("flow.node.id.error", 1)] long nodeId )
        {
            return this._Service.Gets(nodeId);
        }

        public bool Set ( NodeEventSet set )
        {
            return this._Service.Set(set);
        }
    }
}
